#ifndef FILE_APPENDER_CONFIG_H
#define FILE_APPENDER_CONFIG_H

#include "appender_config.h"

#include <vector>
#include <string>

#define DEFAULT_LOG_POSTFIX   ".txt"
#define DEFAULT_LOG_DIRECTORY "./log"
#define DEFAULT_LOG_FILE      "log"

namespace vpm 
{
	namespace log 
	{
		/*
		concept for storing the log file. 
		1. to seperate log file to many small and fix-size file. 
		*/
		class FileAppenderConfig : public AppenderConfig 
		{
		public:
            enum 
            {
                LOG_FILE_SIZE = 20480000, 
            };


			enum LogFileForm
			{
				LOG_FILE_DAILY,    //every day will generate a log file. 
				LOG_FILE_INTERVAL, // every some time, it will generate a log file. 
				LOG_FILE_FIXSIZE,  // the log file should be the fix size.
			};

            FileAppenderConfig()
            {
                m_logFileSize = LOG_FILE_SIZE;
                m_filePath    = DEFAULT_LOG_DIRECTORY; 
                m_filePostfix = DEFAULT_LOG_POSTFIX;
                m_fileName    = DEFAULT_LOG_FILE;
                m_bSingleFile = false; 
            }

            int &file_size()
            {
                return m_logFileSize;
            }

            std::string & file_path()
            {
                return m_filePath; 
            }

            std::string &file_name()
            {
                return m_fileName;
            }

            std::string &file_postfix()
            {
                return m_filePostfix;
            }

            bool &single_file()
            {
                return m_bSingleFile;
            }

		private:
			std::string  m_filePath; 
			std::string  m_fileName; 
            std::string  m_filePostfix; 
			int m_logFileSize; 
            bool m_bSingleFile;
		};
	}
}
#endif // 
